<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateHomeworkScoresTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('homework_scores', function (Blueprint $table) {
//            $table->comment('作业评分表');
            $table->increments('id')->comment('主键ID');
            $table->integer('homework_id')->default(0)->comment('作业关联id');
            $table->integer('user_id')->default(0)->comment('老师关联id');
            $table->integer('scale_id')->default(0)->comment('考核量表id');
            $table->integer('detail_id')->default(0)->comment('考核量表内容id');
            $table->integer('score')->default(0)->comment('自评分数');
            $table->dateTime('score_date')->nullable()->comment('评分时间');
            $table->timestamp('created_at')->useCurrentOnUpdate()->nullable();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('homework_scores');
    }
};
